package com.eastedu.report.scheduler;

import com.eastedu.report.common.model.parameter.ReportExportParameter;
import com.eastedu.report.service.PrincipalMonthlyReportService;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * The type Task scheduler.
 *
 * @author superman
 */
@Configuration
public class ReportTaskScheduler {
    private final PrincipalMonthlyReportService reportService;

    /**
     * Instantiates a new Task scheduler.
     *
     * @param reportService the report service
     */
    public ReportTaskScheduler(PrincipalMonthlyReportService reportService) {
        this.reportService = reportService;
    }


    /**
     * 每月1号早上8点生成校长月报
     */
    @Scheduled(cron = "0 0 8 1 * ?")
    public void generatePrincipalMonthlyReport() {
        reportService.generate(new ReportExportParameter());
    }
}
